<template>
	<view class="integralOrderDetail">
		<view class="box">
			<view class="F6710A tar f24">
				交易成功
			</view>
			<view class="orderDatas flex" v-for="(item,index) in orderData.goods" :key="index">
				<image class="imggoods" :src="$wanlshop.oss(item.image)" mode=""></image>
				<view class="ml20 mt4 flex1">
					<view class="f28 c3d fb overflow_1">
						{{item.title}}
					</view>
					<view class="info flex_sb mt12">
						<view>{{item.description}}</view>
						<view class="">
							X1
						</view>
					</view>
					<view class="flex_sb mt62">
						<view class="cFA750C fb">
							{{item.price}} 积分
						</view>
						<view class="f28 c3d">
							快递包邮
						</view>
					</view>
				</view>
			</view>

			<view class="spzj c3d f24 flex_sb">
				<view class="">
					商品总价
				</view>
				<view class="" v-if="orderData.goods && orderData.goods[0]">
					{{orderData.goods[0].price}}
				</view>
			</view>
			<view class="c3d f24 flex_sb mt20">
				<view class="">
					收货人
				</view>
				<view class="">
					{{orderData.address.name}}
				</view>
			</view>
			<view class="c3d f24 flex_sb mt20">
				<view class="">
					电话号码
				</view>
				<view class="">
					{{orderData.address.mobile}}
				</view>
			</view>
			<view class="c3d f24 flex_sb mt20">
				<view class="">
					收货地址
				</view>
				<view class="flex1 overflow_1 tar">
					{{orderData.address.address}}
				</view>
			</view>
			<view class="c3d f24 flex_sb mt20">
				<view class="">
					订单编号
				</view>
				<view class="">
					{{orderData.order.order_no}}
				</view>
			</view>
			<view class="c3d f24 flex_sb mt20">
				<view class="">
					支付方式
				</view>
				<view class="">
					积分支付
				</view>
			</view>
			<view class="c3d f24 flex_sb mt20">
				<view class="">
					下单时间
				</view>
				<view class="">
					{{orderData.order.createtime_text}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderData: {
					address:{},
					order:{},
					goods:[]
				}
			}
		},
		onLoad(data) {
			this.getorderDetail(data.id)
		},
		methods: {
			getorderDetail(id) {
				this.$api.post({
					url: '/wanlshop/score/orderDetail',
					data: {
						id: id
					},
					success: res => {
						this.orderData = res
					}
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
	.spzj {
		padding: 16rpx;
		border-top: 1rpx solid #D8D8D8;
		border-bottom: 1rpx solid #D8D8D8;
	}

	.F6710A {
		color: #F6710A;
	}

	.integralOrderDetail {
		padding: 32rpx;

		.box {
			padding: 32rpx;
			background: #fff;
			border-radius: 12rpx 12rpx 12rpx 12rpx;
		}
	}

	.orderDatas {
		padding: 38rpx 34rpx;
		background: #FFFFFF;
		border-radius: 12rpx 12rpx 12rpx 12rpx;

		.cFA750C {
			color: #FA750C
		}

		.mt62 {
			margin-top: 62rpx;
		}

		.imggoods {
			width: 200rpx;
			height: 200rpx;
			border-radius: 12rpx;
		}
	}
</style>